package com.ruoyi.web.controller.pdf;

import com.ruoyi.system.mapper.JobImagesParamMapper;
import com.ruoyi.system.service.PDFService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Slf4j
@RestController
@Api(value = "PDF相关操作接口", tags = "PDF相关操作接口")
@RequestMapping("/pdf")
public class PdfController {
    @Resource
    private PDFService pdfService;
    @Resource
    private JobImagesParamMapper jobImagesParamMapper;

    @GetMapping("{id}")
    public void queryById(@PathVariable("id") Integer id, HttpServletRequest request, HttpServletResponse response) {
        log.info("-----------pdf/{}", id);
        pdfService.fillPDFData(id, request, response);
    }

}
